#!/usr/bin/env bash
curl -XPUT http://10.150.24.13:9200/_template/eagleeye-hour-stat -d '
{
"template" : ".eagleeye-hour-stat",
    "settings" : {
      "index.refresh_interval" : "5s",
      "number_of_replicas" : 1,
      "index.number_of_shards":5
    },
    "mappings" : {
      "stat":{
        "properties" : {
          "platformName" : {
            "index" : "not_analyzed",
            "type" : "string"
          },
          "errorCount" : {
            "type" : "long"
          },
          "okCount" : {
            "type" : "long"
          },
          "totalCount" : {
            "type" : "long"
          },
          "percent99" : {
            "type" : "long"
          },
          "percent995" : {
            "type" : "long"
          },
          "statDate":{
            "format": "strict_date_optional_time||epoch_millis",
            "type": "date"
          }
        },
        "_all" : {
          "enabled" : false,
          "omit_norms" : true
        }
      }
    }
}
'
